#ifndef __PALETTE_H
#define __PALETTE_H

#include <vector>
#include <opencv2/opencv.hpp>
#include "color.h"
#include "Bin.h"
#include "commondef.h"
using namespace std;
class ColorBin;
class Palette
{
public:
    Palette(int K,ColorBin *base_bin, int bin_size);
    void Kmeans_init(ColorBin *base_bin,int bin_size);
    void K_means(ColorBin *base_bin,int bin_size);
    void Show_oriPalette(int Palette_size) const;
    void Show_editPalette(int Palette_size);
    void EditPalette(int entry,const ColorLab& color);
    void Calc_Sigmar();
    void Calc_Lambda();
    ColorLabList get_orinPalette() const;
    ColorLabList get_editPalette() const;
    Mat get_Lambda() const;
    float get_Sigma() const;
	int get_K() const;

private:
    int _K;
    ColorLabList _oriPalette;
    ColorLabList _editPalette;
    float _Sigmar;
    Mat _Lambda;
};

#endif // __PALETTE_H

